package com.zmn.plat.common.dictionary;

/**
 * 消息发送方式枚举
 *
 * @author linfeng
 * @since 2020/05/09 14:56:30
 */
public enum MsgSendTypeEnum {

    /**
     * values
     */
    INNERINFO (1, "运营后台消息"),
    DTALKINFO(2, "钉钉消息"),
    MESSAGE(3, "短信")
    ;

    private Integer code;
    private String name;

    MsgSendTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static MsgSendTypeEnum of(Integer code) {
        if (code == null || code == 0) {
            return INNERINFO;
        }
        switch (code) {
            case 1:
                return INNERINFO;
            case 2:
                return DTALKINFO;
            case 3:
                return MESSAGE;
            default:
                return INNERINFO;
        }
    }
}
